<template>
    <div class="dayDeatail-container">
        <div class="photo-cont">
            <img :src="data.imgUrl">
            <div class="title">{{data.commodityName}}</div>
        </div>
        <ul class="list-cont">
            <li class="item">
                <span>代理商名称</span>
                <span>{{data.commodityName}}</span>
            </li>
            <li class="item">
                <span>交易时间</span>
                <span>{{data.creatDate}}</span>
            </li>
            <li class="item" v-if="type==4">
                <span>当前阶段</span>
                <span>{{data.status}}</span>
            </li>
            <li class="item" v-if="type==4">
                <span>购买阶段</span>
                <span>{{data.buyStatus}}</span>
            </li>
            <li class="item">
                <span>单价</span>
                <span>¥{{data.buyPrice}}</span>
            </li>
            <li class="item" v-if="type==4 || type==7">
                <span>数量</span>
                <span>{{data.buyNum}}</span>
            </li>
            <li class="item">
                <span>合计分润</span>
                <span>¥{{data.amount}}</span>
            </li>
        </ul>
        <com-footer :currentIndex="cuIndex"></com-footer>
    </div>
</template>
<script>
    import comFooter from '../../components/comFooter';
    import dataApi from '../../api/data.js';
    import { Toast } from 'mint-ui';
    export default {
        components: {
            comFooter
        },
        data () {
            return {
                cuIndex: 1,
                comeId: '',
                data: {},
                obj:{},
                type:''
            }
        },
        created() {
            let str = localStorage.getItem('dongHang_data');
            this.obj = JSON.parse(str);
            this.comeId = this.$route.query.id;
            this.type = this.$route.query.type;
            dataApi.dayInDeatailApi(this.comeId).then(res => {
                if (res.code == 0) {
                    this.data = res.t;
                } else {
                    Toast({
                        message: res.message,
                        duration: 2000
                    });
                }
            })
        },
    }
</script>
<style lang="less" scoped>
    .dayDeatail-container {
        .photo-cont {
            padding:.4rem 0;
            border-bottom: 1px solid #ccc;
            img {
                margin: 0 auto;
                display: block;
                width: 1.5rem;
                height: 1.5rem;
                border-radius: .2rem;
            }
            .title {
                margin-top: .3rem;
                font-size: .3rem;
                font-weight: bold;
                text-align: center;
            }
        }
        .list-cont {
            .item {
                padding: 0 .3rem;
                font-size: .28rem;
                height: .8rem;
                border-bottom: 1px solid #ccc;
                span {
                    display: inline-block;
                    
                    height: .8rem;
                    line-height: .8rem;
                }
                span:last-child {
                    float: right;
                }
            }
            .item:last-child {
                font-weight: bold;
            }
        }
    }
</style>